import BaseConfig from "./base";

//预约座位
export function makeAppointment(data) {
  return BaseConfig({
    method: "post",
    url: "/make_appointment",
    data,
  });
}

//该用户预约是否该阅览室
export function hasAppointment(data) {
  return BaseConfig({
    method: "post",
    url: "/has_appointment",
    data,
  });
}

//取消预约
export function cancelAppointment(data) {
  return BaseConfig({
    method: "post",
    url: "/cancel_appointment",
    data,
  });
}

//更改预约时间
export function changeDate(data) {
  return BaseConfig({
    method: "post",
    url: "/change_date",
    data,
  });
}

//获取已预约信息
export function getAppointment() {
  return BaseConfig({
    url: "/appointment",
  });
}

//获取该阅览室的座位在该时间段的预约情况
export function getSeatState(data) {
  return BaseConfig({
    url: "/seat_state",
    params: {
      ...data,
    },
  });
}

//是否已达到预约数量上限
export function getAppointmentNum() {
  return BaseConfig({
    url: "/get_appointment_num",
  });
}

//获取用户在该时间段是否已有其他预约
export function appointmentInDateTime(data) {
  return BaseConfig({
    url: "/has_appointment_in_time",
    params: {
      ...data,
    },
  });
}

//获取阅览室在该时间段是否已被其他人预约
export function appointmentInDateTimeByOther(data) {
  return BaseConfig({
    url: "/has_appointment_by_other",
    params: {
      ...data,
    },
  });
}

//意见反馈
export function postFeedback(data) {
  return BaseConfig({
    url: "/post_feedback",
    method: "post",
    data,
  });
}

//获取我的意见反馈
export function getMyFeedback() {
  return BaseConfig({
    url: "/get_my_feedback",
  });
}

//评价意见回复
export function judgeAnswer(data) {
  return BaseConfig({
    method: "post",
    url: "/judge_answer",
    data,
  });
}

//获取基本信息
export function getInfo() {
  return BaseConfig({
    url: "/get_info",
  });
}

//更改基本信息
export function updateInfo(data) {
  return BaseConfig({
    method: "post",
    url: "/update_info",
    data,
  });
}


//签到
export function check(data) {
  return BaseConfig({
    method: "post",
    url: "/signin",
    data,
  });
}